package com.example.beidouapplication;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableField;

import com.example.beidouapplication.databinding.FragmentShuruxinzuobiaoBinding;
import com.example.beidouapplication.viewmodel.ChuShiZuoBiao;


public class FragmentQidongShuRuZuoBiao extends Fragment {

    Button btn_queren;

    static FragmentQidongShuRuZuoBiao instance = new FragmentQidongShuRuZuoBiao();

    FragmentShuruxinzuobiaoBinding binding;


    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {

        int layout = R.layout.fragment_shuruxinzuobiao;

        binding = DataBindingUtil.inflate(inflater, layout, container, false);
        binding.setZuobiao(MainActivity.cszb);
        return binding.getRoot();
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        btn_queren = (Button) getActivity().findViewById(R.id.btn_shuruzuobiao_queren);

        btn_queren.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
                FragmentQidongShuRuZuoBiaoQueRen shuRuZuoBiao = FragmentQidongShuRuZuoBiaoQueRen.instance;
//                ft.hide(FragmentQidongShuRuZuoBiao.this);
                ft.replace(R.id.contentFrame, shuRuZuoBiao);
//                ft.replace(R.id.fl_content,fragmentThree);
                ft.addToBackStack(null);//添加到回退栈
                ft.commit();
            }
        });
    }

}